package com.java.module.user.service.impl;

import java.util.List;
import com.java.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.java.module.user.mapper.SearchMapper;
import com.java.module.user.domain.Search;
import com.java.module.user.service.ISearchService;

/**
 * 搜索查询Service业务层处理
 * 
 * @author Administrator
 * @date 2025-06-20
 */
@Service
public class SearchServiceImpl implements ISearchService {
    @Autowired
    private SearchMapper searchMapper;

    /**
     * 查询搜索查询
     * 
     * @param selectId 搜索查询ID
     * @return 搜索查询
     */
    @Override
    public Search selectSearchById(Long selectId) {
        return searchMapper.selectSearchById(selectId);
    }

    /**
     * 查询搜索查询
     *
     * @param search 搜索查询
     * @return 搜索查询
     */
    @Override
    public Search selectSearchOne(Search search) {
        return searchMapper.selectSearchOne(search);
    }

    /**
     * 查询搜索查询列表
     * 
     * @param search 搜索查询
     * @return 搜索查询
     */
    @Override
    public List<Search> selectSearchList(Search search) {
        return searchMapper.selectSearchList(search);
    }

    /**
     * 新增搜索查询
     * 
     * @param search 搜索查询
     * @return 结果
     */
    @Override
    public int insertSearch(Search search) {
        search.setCreateTime(DateUtils.getNowDate());
        return searchMapper.insertSearch(search);
    }

    /**
     * 修改搜索查询
     * 
     * @param search 搜索查询
     * @return 结果
     */
    @Override
    public int updateSearch(Search search) {
        search.setUpdateTime(DateUtils.getNowDate());
        return searchMapper.updateSearch(search);
    }

    /**
     * 批量删除搜索查询
     * 
     * @param selectIds 需要删除的搜索查询ID
     * @return 结果
     */
    @Override
    public int deleteSearchByIds(Long[] selectIds) {
        return searchMapper.deleteSearchByIds(selectIds);
    }

    /**
     * 删除搜索查询信息
     * 
     * @param selectId 搜索查询ID
     * @return 结果
     */
    @Override
    public int deleteSearchById(Long selectId) {
        return searchMapper.deleteSearchById(selectId);
    }
}
